Repository navigation
feat(xsender): the answers are generated from the core's schema - #11
Merged
Merged
Conversation
`make sync` now also copies src/xhandler/xsender/models_gen.py: the SUNAT answers (SendFileAnswer, VerifyResult, ConsultResult, CDR, Fault, NoCDR, ConsultStatus, Status) generated from the schema of the core, so a field added to them in xhandler-rust arrives with the next core sync (xhandler-rust docs/adrs/BINDINGS.md). They ignore fields a newer core adds. The hand-written copies are gone; SendResult extends SendFileAnswer, and xhandler.xsender exports the same names, with the same fields, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The SUNAT answers were typed by hand here. A field added in xhandler-rust (like the CDR's
document_description) needed a hand edit in every binding, and could be silently dropped. xhandler-rust 6.0.0-alpha.2 generates them from the core's schema (project-openubl/xhandler-rust#613,docs/adrs/BINDINGS.md). This is the last step of that design: from now on, a new answer field arrives with the release's sync PR, with no hand edit.What
make syncalso copiessrc/xhandler/xsender/models_gen.py. It's inSYNCEDand excluded from ruff, like the xbuilder models.xsender/models.pykeeps the inputs and re-exports the generated answers.SendResultextends the generatedSendFileAnswer.xhandler.xsenderexports the same names, with the same fields, as before.SendFileAnsweris new.Verified
ruff, mypy and pytest (1139 tests) pass.
make verify-release TAG=v6.0.0-alpha.2passes.Senior review
Two passes. Findings applied:
__all__completedJson.MAPPERandXhandlerException, and copies the notes listThe second pass found nothing left.
🤖 Generated with Claude Code